export function debounce(fn: Function, delay=100) {
  let timer
  return function(...args) {
    if (timer) {
      clearTimeout(timer)
    }
    timer = setTimeout(() => {
      fn(...args);
    }, delay)
  }
}